import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@angular/core';
// tslint:disable
@Directive({
    selector: '[appGridImage]',
})
export class GridItemImageDirective implements OnInit{ 
    @Input() appGridImage = '2rem';
    @Input() fitMode = 'cover';
    constructor(private elr:ElementRef,private rd2:Renderer2){
        
    }
    ngOnInit(): void {
        this.rd2.setStyle(this.elr.nativeElement,'grid-area','image')
        this.rd2.setStyle(this.elr.nativeElement,'width',this.appGridImage)
        this.rd2.setStyle(this.elr.nativeElement,'height',this.appGridImage)
        this.rd2.setStyle(this.elr.nativeElement,'object-fit',this.fitMode)
    }
    @HostListener('click',['$event.target'])
    handleClick(ev:any){
     console.log(ev);
    }
}